#include "ASBullet.h"

NS_AS_BEGIN

ASBullet::ASBullet(int senderID,int targetID,int nAttrsNumI ,int nAttrsNumF)
:ASEntity(nAttrsNumI,nAttrsNumF)
,_iSenderID(senderID)
,_iTargetID(targetID)
,_pSender(nullptr)
,_pTarget(nullptr)
,_bSenderValid(false)
,_bTargetValid(false)
{

}

ASBullet::~ASBullet()
{
}

ASEntity* ASBullet::getSender()
{
	if (!_bSenderValid) {
		//to do
		//ASEntity* pSender = EntityManager::getSender(_iSenderID);
		//if (pSender&&!pSender->getActive())
		//{
		//	pSender = nullptr;
		//}
		//_pSender = pSender;
		//_bSenderValid = true;
	}
	return _pSender;
}
ASEntity* ASBullet::getTarget()
{
	if (!_bTargetValid) {
		//to do
		//ASEntity* pTarget = EntityManager::getSender(_iTargetID);
		//if (pTarget&&!pTarget->getActive())
		//{
		//	pTarget = nullptr;
		//}
		//_pTarget = pTarget;
		//_bTargetValid = true;
	}
	return _pTarget;
}


NS_AS_END